<template>
  <div>
    <f-form ref='form' :action='api.sendInfo' :form-key='this.formItem.sendInfoId' :file-ids='fileIds'>
      <div>
        <f-form-item label='出库单号' name='outOrderNo' disabled :value.sync='formItem.outOrderNo' />
        <f-form-item label='快递公司' name='fastMailName'  :value.sync='formItem.fastMailName' />
        <f-form-item label='物流单号' name='fastMailNo'  :value.sync='formItem.fastMailNo' />
      </div>
    </f-form>
  </div>
</template>
<script>

import api from "../../../js/api"

export default {
  name: "FastmailEdit",
  components: {},
  data() {
    let me = this
    return {
      api: Object.assign(api, this.api),
      //列表初始化查询参数
      queryParam: {},
      loaded: false,
      selectIds: "",
      fileIds: null,
      formItem: this.getFormItem()
    }
  },
  created() {
  },
  computed: {},
  methods: {
    getFormItem() {
      return {
        sendInfoId: "",
        fastMailName: "百世快递",
        fastMailNo: "",
      }
    },
    setData(data) {
      if (data.orderId) {
        this.$refs.form.resetFields()
        this.formItem = data
        this.http.get(this, {
          url: this.api.hyorder.get,
          params: {
            handlerName: "hyOrderGetHandler",
            orderId: data.orderId
          },
          success: function(me, data) {
            me.formItem = data
            me.loaded = true
          }
        })
      }
    },
    /**
     * 文件上传回调
     */
    uploadSuccess(fileUrl, files, fileIds, removeIds) {
      this.fileIds = fileIds
      this.removeIds.push(...removeIds)
    },
    handleSubmit() {
      this.$refs["form"].submit({
        orderId: this.formItem.orderId
      }, this.handleSuccess)
    },
    handleSuccess() {
      this.$emit("closeDrawer", false)
    }
  }
}
</script>
